﻿/**
   \file hexfile.h

   \author G. Icking-Konert

   \brief declaration of routines for HEX, S19 and table files

   declaration of routines for importing and exporting Motorola S19 and Intel HEX files,
   as well as plain ASCII tables.
   (format descriptions under http://en.wikipedia.org/wiki/SREC_(file_format) or
   http://www.keil.com/support/docs/1584.htm).
*/

// for including file only once
#ifndef _HEXFILE_H_
#define _HEXFILE_H_

/**********************
 INCLUDES
**********************/
#include "memory_image.h"

/*******
  global macros
*******/

#define  HEXFILE_DEBUG_MSG 0

#ifdef __cplusplus
extern "C" {
#endif

/**********************
 GLOBAL FUNCTIONS
**********************/

/// read Motorola s19 file into memory image
bool  import_file_s19(const wchar_t *filename, MemoryImage_s *image);

/// read Intel hex file into memory image
bool  import_file_ihx(const wchar_t *filename, MemoryImage_s *image);

/// read plain text table (hex addr / data) file into memory image
bool  import_file_txt(const wchar_t *filename, MemoryImage_s *image);

/// read binary file into memory image
bool  import_file_bin(const wchar_t *filename, const MEMIMAGE_ADDR_T addrStart, MemoryImage_s *image);

#ifdef __cplusplus
}
#endif
#endif // _HEXFILE_H_
